/*
 * @author: huangww
 * @Date: 2021-02-22 14:41:44
 * @LastEditTime: 2021-02-22 15:07:25
 * @FilePath: \fMgr\src\core\base\SceneComponent.ts
 */
namespace core {

    export abstract class SceneComponent extends Component {
        UIType: COMPONENTTYPE;
        protected sceneType: SCENETYPE;  //场景UI类型枚举
        protected _openAction: boolean;   //记录是否已经播放UI动画
        constructor(type: COMPONENTTYPE, sceneType: SCENETYPE) {
            super(type);
            this.UIType = type;
            this.sceneType = sceneType;
            this._openAction = false;
        }

        getSceneType() {
            return this.sceneType;
        }

        hasOpenAction() {
            return this._openAction;
        }
        /**
         * 当上层UI界面打开时播放该动画
         * 如果场景有特别的关于打开的动画可重写,需调用父类当前方法
         */
        openAction() {
            this._openAction = true;
        }
        /**
         * 当上层UI界面关闭时播放该动画
         * 如果场景有特别的关于打开的动画可重写
         */
        closeAction() {
            this._openAction = false;
        }
    }
}